Welcome to “Deploying and Running Applications.” After watching this video, you will be able to explain two main modes of deploying
a container image-based application, describe how to use IBM Cloud Console
for the app deployment process, and describe how to use IBM Cloud
CLI for the app deployment process. You can deploy your container image-based application to IBM Cloud Code
using either of the two modes: First, you could build and
push your container image to either a private or public container registry. The Cloud Code Engine can pull the
image with a unique image name and then deploy it automatically
by granting registry access. Or, if you do not want to manually
build your image, you can specify a dockerfile or a buildpack along with
your code and give instructions to the Cloud Engine to build your application
from source code and then deploy it. So essentially, the two modes are the same. The only difference is who is responsible
for building and pushing the container image. IBM Cloud Console is a well-designed web
portal for end users to conveniently manage their IBM cloud services,
including the Code Engine. In the IBM Cloud Console, you can easily create
and deploy the application with just a few clicks. If you are familiar with the command line
interface (CLI) and want to perform more precise deployment, you can choose IBM Cloud
CLI to create and deploy the application. And then after your application has been
deployed on the Code Engine, the Engine will provide an
endpoint URL of your application which can lead to the main
page of your application or the entry endpoint of your microservice. As discussed, the IBM Cloud Console provides a well-designed user interface to help you
create and deploy your application easily. Now let’s see the main steps
to create an application. First, you need to specify
your application’s name. Then, you can select to deploy from
a Container image or a Source code. Here you select the default
Container image option. And next, you need to provide the
reference to your image and, optionally, the registry access so that the code
engine can pull your image from the registry. But note that these are
just the main steps. There are other advanced settings you can
configure as required by your application. So, after the application is created, the
cloud engine will deploy it automatically. If the application runs without errors,
it should be ready within several minutes. After the application is ready, you can click
Test application to test it using a URL. Alternatively, if you prefer
the command line interface, you can deploy your app using IBM Cloud CLI. The main command to create and deploy an
application is “ibmcloud ce app create”: It has three main arguments: the name of your application, the image reference in a container
registry, and a registry access, if the container registry is not public. Let’s see an example: Here you want to create an application called ‘helloworldapp’ from an image
in us.icr.io registry server. For the Code Engine to pull the image, you create
and provide a registry access called ‘myregistry.’ Now after the application is created and deployed, you can run and test your application
using “ibmcloud ce app get” command, which has two main arguments the name of your application, and the output format of your
application, such as a URL. Here, let’s see an example
to get the output of the previously deployed application “helloworldapp.” You call ibmcloud ce app get with the app
name, and you specify the output format as URL. Then you can see the publicly accessible URL
of your application from the command output. In this video, you learned that you can create a Cloud Engine application either from a pushed container image
or a source code repository. And per your preference, you can
select to use IBM Cloud Console or IBM Cloud CLI to perform the
application deployment tasks.